<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui">
<h:head>
	<title>Detalle Carrito</title>
</h:head>
<h:body>
	<h:form>
		<p:dataTable value="#{carritoMB.proarray}" var="pro">
			<f:facet name="header">DETALLE DE SU CARRITO</f:facet>
			<p:column>
				<f:facet name="header">NOMBRE</f:facet>
				<h:outputText value="#{pro.nombre}" />
			</p:column>
			<p:column>
				<f:facet name="header">PRECIO</f:facet>
				<h:outputText value="#{pro.precio}" />
			</p:column>
			<p:column>
				<f:facet name="header">CANTIDAD</f:facet>
				<h:outputText value="#{pro.cantidad}" />
			</p:column>
			<p:column>
				<f:facet name="header">SUB TOTAL</f:facet>
				<h:outputText value="#{pro.subtotal}" />
			</p:column>
			<p:column>
				<f:facet name="header">ACCION</f:facet>
				<h:commandButton value="[+]" action="#{carritoMB.sumarProductoDetalle(pro.id)}" />
				<h:commandButton value="[-]" action="#{carritoMB.restarProductoDetalle(pro.id)}" />
				<h:commandButton value="[del]" action="#{carritoMB.borrarProductoDetalle(pro)}" />
			</p:column>
		</p:dataTable>
		<p:commandButton value="[buy]" action="#{carritoMB.finalizarCompra()}" />
		<p:commandButton value="[back]" action="Carrito" />
		<h1>
			Total $ :
			<h:outputText value="#{carritoMB.getTotalApagar()}" />
		</h1>
		<div style="width: 300px;">
				<p:messages id="menGen" /></div>
	</h:form>



</h:body>
</html>